#include<iostream>
#include<cmath>
using namespace std;
int main(){
  long long n=0,a,b;
  cin>>a>>b;
  int day=1;
  for(int i=0;i<b;i++){
    day*=a;
    day%=7;
  }
  n+=day;
  switch(n) {
    case 0:
      cout<<"Sunday";
      break;
    case 1:
      cout<<"Monday";
      break;
    case 2:
      cout<<"Tuesday";
      break;
    case 3:
      cout<<"Wednesday";
      break;
    case 4:
      cout<<"Thursday";
      break;
    case 5:
      cout<<"Friday";
      break;
    case 6:
      cout<<"Saturday";
      break;

  }
}